function UserAddress(params){ 
	 
}

UserAddress.Where = function(type,proxy){
	this.type = type;
	this.proxy=proxy;
	this.linked = null;
	this.set = null;
	if(this.type==0){
		this.set = new UserAddress.Where(1,true);
		this.set.linked = this;
	}
	this.getProxy = function(){
		var m = new UserAddress.Where(this.type);//当前的对像
		if(this.type==0){
			m.set = new UserAddress.Where(1,true);//set对象
			m.set.linked = m;
		}else{
			m.linked=this.linked;
			this.linked.linked=m;
		}
		return m;
	}
	this.data = {};
	this.put = function(key,value){
		this.data[key] = value;
	}
	this.get = function(key){
		return this.data[key];
	}
	/** 编号 [非空]       **/
	this.id=function(id){if(this.proxy)return this.getProxy().id(id);  this.put("id", id);return this;};
	/** and id is null */
	this.idNull=function(){if(this.proxy)return this.getProxy().idNull();if(this.get("idNot")==null)this.put("idNot", "");this.put("id", null);return this;};
	/** not .... */
	this.idNot=function(){if(this.proxy)return this.getProxy().idNot();this.put("idNot", "not");return this;};
	this.idNotNull=function(){if(this.proxy)return this.getProxy().idNotNull();this.put("idNot", "not");this.put("id", null);return this;};
	this.idNot=function(id){if(this.proxy)return this.getProxy().idNot(id);this.put("idNot", "not");this.put("id", id);return this;};
	/** and id <= ? */
	this.idMin=function(min){if(this.proxy)return this.getProxy().idMin(min);this.put("idMin", min);return this;};
	/** and id >= ? */
	this.idMax=function(max){if(this.proxy)return this.getProxy().idMax(max);this.put("idMax", max);return this;};
	this.idIn=function(ids){
		if(this.proxy)return this.getProxy().idIn(ids);  this.put("idIn", ids);return this;
	};	
	
	/** 会员信息  [Member]      **/
	this.member=function(member){if(this.proxy)return this.getProxy().member(member);  this.put("member", member);return this;};
	/** and member is null */
	this.memberNull=function(){if(this.proxy)return this.getProxy().memberNull();if(this.get("memberNot")==null)this.put("memberNot", "");this.put("member", null);return this;};
	/** not .... */
	this.memberNot=function(){if(this.proxy)return this.getProxy().memberNot();this.put("memberNot", "not");return this;};
	this.memberNotNull=function(){if(this.proxy)return this.getProxy().memberNotNull();this.put("memberNot", "not");this.put("member", null);return this;};
	this.memberNot=function(member){if(this.proxy)return this.getProxy().memberNot(member);this.put("memberNot", "not");this.put("member", member);return this;};
	this.memberIn=function(ids){
		if(this.proxy)return this.getProxy().memberIn(ids);  this.put("memberIn", ids);return this;
	};	
	
	/** 电话号码        **/
	this.mobile=function(mobile){if(this.proxy)return this.getProxy().mobile(mobile);  this.put("mobile", mobile);return this;};
	/** and mobile is null */
	this.mobileNull=function(){if(this.proxy)return this.getProxy().mobileNull();if(this.get("mobileNot")==null)this.put("mobileNot", "");this.put("mobile", null);return this;};
	/** not .... */
	this.mobileNot=function(){if(this.proxy)return this.getProxy().mobileNot();this.put("mobileNot", "not");return this;};
	this.mobileNotNull=function(){if(this.proxy)return this.getProxy().mobileNotNull();this.put("mobileNot", "not");this.put("mobile", null);return this;};
	this.mobileNot=function(mobile){if(this.proxy)return this.getProxy().mobileNot(mobile);this.put("mobileNot", "not");this.put("mobile", mobile);return this;};
	
	/** 收货姓名        **/
	this.realName=function(realName){if(this.proxy)return this.getProxy().realName(realName);  this.put("realName", realName);return this;};
	/** and real_name is null */
	this.realNameNull=function(){if(this.proxy)return this.getProxy().realNameNull();if(this.get("realNameNot")==null)this.put("realNameNot", "");this.put("realName", null);return this;};
	/** not .... */
	this.realNameNot=function(){if(this.proxy)return this.getProxy().realNameNot();this.put("realNameNot", "not");return this;};
	this.realNameNotNull=function(){if(this.proxy)return this.getProxy().realNameNotNull();this.put("realNameNot", "not");this.put("realName", null);return this;};
	this.realNameNot=function(realName){if(this.proxy)return this.getProxy().realNameNot(realName);this.put("realNameNot", "not");this.put("realName", realName);return this;};
	
	/** 性别    1:男 2:女     **/
	this.sex=function(sex){if(this.proxy)return this.getProxy().sex(sex);  this.put("sex", sex);return this;};
	/** and sex is null */
	this.sexNull=function(){if(this.proxy)return this.getProxy().sexNull();if(this.get("sexNot")==null)this.put("sexNot", "");this.put("sex", null);return this;};
	/** not .... */
	this.sexNot=function(){if(this.proxy)return this.getProxy().sexNot();this.put("sexNot", "not");return this;};
	this.sexNotNull=function(){if(this.proxy)return this.getProxy().sexNotNull();this.put("sexNot", "not");this.put("sex", null);return this;};
	this.sexNot=function(sex){if(this.proxy)return this.getProxy().sexNot(sex);this.put("sexNot", "not");this.put("sex", sex);return this;};
	this.sexIn=function(ids){
		if(this.proxy)return this.getProxy().sexIn(ids);  this.put("sexIn", ids);return this;
	};	
	
	/** 默认    0:否 1:默认     **/
	this.isDefault=function(isDefault){if(this.proxy)return this.getProxy().isDefault(isDefault);  this.put("isDefault", isDefault);return this;};
	/** and is_default is null */
	this.isDefaultNull=function(){if(this.proxy)return this.getProxy().isDefaultNull();if(this.get("isDefaultNot")==null)this.put("isDefaultNot", "");this.put("isDefault", null);return this;};
	/** not .... */
	this.isDefaultNot=function(){if(this.proxy)return this.getProxy().isDefaultNot();this.put("isDefaultNot", "not");return this;};
	this.isDefaultNotNull=function(){if(this.proxy)return this.getProxy().isDefaultNotNull();this.put("isDefaultNot", "not");this.put("isDefault", null);return this;};
	this.isDefaultNot=function(isDefault){if(this.proxy)return this.getProxy().isDefaultNot(isDefault);this.put("isDefaultNot", "not");this.put("isDefault", isDefault);return this;};
	/** and is_default <= ? */
	this.isDefaultMin=function(min){if(this.proxy)return this.getProxy().isDefaultMin(min);this.put("isDefaultMin", min);return this;};
	/** and is_default >= ? */
	this.isDefaultMax=function(max){if(this.proxy)return this.getProxy().isDefaultMax(max);this.put("isDefaultMax", max);return this;};
	this.isDefaultIn=function(ids){
		if(this.proxy)return this.getProxy().isDefaultIn(ids);  this.put("isDefaultIn", ids);return this;
	};	
	
	/** 地址  [Region]      **/
	this.address=function(address){if(this.proxy)return this.getProxy().address(address);  this.put("address", address);return this;};
	/** and address is null */
	this.addressNull=function(){if(this.proxy)return this.getProxy().addressNull();if(this.get("addressNot")==null)this.put("addressNot", "");this.put("address", null);return this;};
	/** not .... */
	this.addressNot=function(){if(this.proxy)return this.getProxy().addressNot();this.put("addressNot", "not");return this;};
	this.addressNotNull=function(){if(this.proxy)return this.getProxy().addressNotNull();this.put("addressNot", "not");this.put("address", null);return this;};
	this.addressNot=function(address){if(this.proxy)return this.getProxy().addressNot(address);this.put("addressNot", "not");this.put("address", address);return this;};
	this.addressIn=function(ids){
		if(this.proxy)return this.getProxy().addressIn(ids);  this.put("addressIn", ids);return this;
	};	
	
	/** 详细地址        **/
	this.detailAddress=function(detailAddress){if(this.proxy)return this.getProxy().detailAddress(detailAddress);  this.put("detailAddress", detailAddress);return this;};
	/** and detail_address is null */
	this.detailAddressNull=function(){if(this.proxy)return this.getProxy().detailAddressNull();if(this.get("detailAddressNot")==null)this.put("detailAddressNot", "");this.put("detailAddress", null);return this;};
	/** not .... */
	this.detailAddressNot=function(){if(this.proxy)return this.getProxy().detailAddressNot();this.put("detailAddressNot", "not");return this;};
	this.detailAddressNotNull=function(){if(this.proxy)return this.getProxy().detailAddressNotNull();this.put("detailAddressNot", "not");this.put("detailAddress", null);return this;};
	this.detailAddressNot=function(detailAddress){if(this.proxy)return this.getProxy().detailAddressNot(detailAddress);this.put("detailAddressNot", "not");this.put("detailAddress", detailAddress);return this;};
	
	/** 所属城市  [Region]      **/
	this.cityOrigin=function(cityOrigin){if(this.proxy)return this.getProxy().cityOrigin(cityOrigin);  this.put("cityOrigin", cityOrigin);return this;};
	/** and city_origin is null */
	this.cityOriginNull=function(){if(this.proxy)return this.getProxy().cityOriginNull();if(this.get("cityOriginNot")==null)this.put("cityOriginNot", "");this.put("cityOrigin", null);return this;};
	/** not .... */
	this.cityOriginNot=function(){if(this.proxy)return this.getProxy().cityOriginNot();this.put("cityOriginNot", "not");return this;};
	this.cityOriginNotNull=function(){if(this.proxy)return this.getProxy().cityOriginNotNull();this.put("cityOriginNot", "not");this.put("cityOrigin", null);return this;};
	this.cityOriginNot=function(cityOrigin){if(this.proxy)return this.getProxy().cityOriginNot(cityOrigin);this.put("cityOriginNot", "not");this.put("cityOrigin", cityOrigin);return this;};
	this.cityOriginIn=function(ids){
		if(this.proxy)return this.getProxy().cityOriginIn(ids);  this.put("cityOriginIn", ids);return this;
	};	
	
	/** 地址全称        **/
	this.fullAddress=function(fullAddress){if(this.proxy)return this.getProxy().fullAddress(fullAddress);  this.put("fullAddress", fullAddress);return this;};
	/** and full_address is null */
	this.fullAddressNull=function(){if(this.proxy)return this.getProxy().fullAddressNull();if(this.get("fullAddressNot")==null)this.put("fullAddressNot", "");this.put("fullAddress", null);return this;};
	/** not .... */
	this.fullAddressNot=function(){if(this.proxy)return this.getProxy().fullAddressNot();this.put("fullAddressNot", "not");return this;};
	this.fullAddressNotNull=function(){if(this.proxy)return this.getProxy().fullAddressNotNull();this.put("fullAddressNot", "not");this.put("fullAddress", null);return this;};
	this.fullAddressNot=function(fullAddress){if(this.proxy)return this.getProxy().fullAddressNot(fullAddress);this.put("fullAddressNot", "not");this.put("fullAddress", fullAddress);return this;};
	
	/** 经度        **/
	this.longitude=function(longitude){if(this.proxy)return this.getProxy().longitude(longitude);  this.put("longitude", longitude);return this;};
	/** and longitude is null */
	this.longitudeNull=function(){if(this.proxy)return this.getProxy().longitudeNull();if(this.get("longitudeNot")==null)this.put("longitudeNot", "");this.put("longitude", null);return this;};
	/** not .... */
	this.longitudeNot=function(){if(this.proxy)return this.getProxy().longitudeNot();this.put("longitudeNot", "not");return this;};
	this.longitudeNotNull=function(){if(this.proxy)return this.getProxy().longitudeNotNull();this.put("longitudeNot", "not");this.put("longitude", null);return this;};
	this.longitudeNot=function(longitude){if(this.proxy)return this.getProxy().longitudeNot(longitude);this.put("longitudeNot", "not");this.put("longitude", longitude);return this;};
	
	/** 纬度        **/
	this.latitude=function(latitude){if(this.proxy)return this.getProxy().latitude(latitude);  this.put("latitude", latitude);return this;};
	/** and latitude is null */
	this.latitudeNull=function(){if(this.proxy)return this.getProxy().latitudeNull();if(this.get("latitudeNot")==null)this.put("latitudeNot", "");this.put("latitude", null);return this;};
	/** not .... */
	this.latitudeNot=function(){if(this.proxy)return this.getProxy().latitudeNot();this.put("latitudeNot", "not");return this;};
	this.latitudeNotNull=function(){if(this.proxy)return this.getProxy().latitudeNotNull();this.put("latitudeNot", "not");this.put("latitude", null);return this;};
	this.latitudeNot=function(latitude){if(this.proxy)return this.getProxy().latitudeNot(latitude);this.put("latitudeNot", "not");this.put("latitude", latitude);return this;};
	
	/** 坐标地址        **/
	this.coordinate=function(coordinate){if(this.proxy)return this.getProxy().coordinate(coordinate);  this.put("coordinate", coordinate);return this;};
	/** and coordinate is null */
	this.coordinateNull=function(){if(this.proxy)return this.getProxy().coordinateNull();if(this.get("coordinateNot")==null)this.put("coordinateNot", "");this.put("coordinate", null);return this;};
	/** not .... */
	this.coordinateNot=function(){if(this.proxy)return this.getProxy().coordinateNot();this.put("coordinateNot", "not");return this;};
	this.coordinateNotNull=function(){if(this.proxy)return this.getProxy().coordinateNotNull();this.put("coordinateNot", "not");this.put("coordinate", null);return this;};
	this.coordinateNot=function(coordinate){if(this.proxy)return this.getProxy().coordinateNot(coordinate);this.put("coordinateNot", "not");this.put("coordinate", coordinate);return this;};
	
	
	
	this.add=function(key,value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	this.desc=function(sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	this.asc=function(sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	this.definex=function(sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	
	/** 获取所有收货地址 **/
	this.list=function(size){
		this.data.size = size;
		var protocol = ux.ajax("/admin/users/useraddress.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list)return protocol.data.list;
		return [];
	}
	/** 获取收货地址分页 **/
	this.page=function(page,size){
		this.data.size = size;
		this.data.page = page;
		var protocol = ux.ajax("/admin/users/useraddress.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data)return data;
		return {list:[]};
	}
	/** 根据查询条件取收货地址 **/
	this.get=function(){
		this.data.size = 1;
		var protocol = ux.ajax("/admin/users/useraddress.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list && protocol.data.list.length==1)return protocol.data.list[0]; 
		return null;
	}
}

UserAddress.get = function(id){
	var protocol = ux.ajax("/admin/users/useraddress.get.do",{id:id});
	if(!protocol)return null;
	if(protocol.data)return protocol.data.userAddress;
	return null;
}

UserAddress.where = new UserAddress.Where(0,true);